﻿using Newtonsoft.Json;
using Pay.Core;
using Pay.TO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.DTO {
    /// <summary>
    /// 用户消费记录表
    /// </summary>
    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class user_comsume_his_dto {
        /// <summary>
        /// 消费记录Id
        /// </summary>
        public long id { get; set; }

        /// <summary>
        /// 用户Id
        /// </summary>
        public long user_id { get; set; }

        /// <summary>
        /// 消费项目类型（枚举）
        /// </summary>
        public EConsumeItemType consume_type { get; set; }

        /// <summary>
        /// 消费项目类型枚举描述
        /// </summary>
        public string consume_type_title { get { return this.consume_type.ToDescription(); } }

        /// <summary>
        /// 附加信息(根据消费类型,附加信息有所不同; 加油卡充值:加油卡卡号, 商品兑换:商品名称)
        /// </summary>
        public string info { get; set; }

        /// <summary>
        /// 兑换商品 商品Id
        /// </summary>
        public long? product_id { get; set; }

        /// <summary>
        /// 订单号
        /// </summary>
        public string order_no { get; set; }

        /// <summary>
        /// 消费红钻数
        /// </summary>
        public decimal consume_red_drill { get; set; }

        /// <summary>
        /// 充值金额
        /// </summary>
        public decimal? recharge_amount { get; set; }

        /// <summary>
        /// 状态（1：成功，2：失败）
        /// </summary>
        public EUserComsumeHisStatus status { get; set; }

        /// <summary>
        /// 状态枚举值描述
        /// </summary>
        public string status_title { get { return this.status.ToDescription(); } }

        /// <summary>
        ///收货地址id
        /// </summary>
        public long? ship_adress_id { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime create_time { get; set; }

        /// <summary>
        /// 用户信息
        /// </summary>
        public virtual merchant_dto merchant { get; set; }
    }

    /// <summary>
    /// 用户消费记录表
    /// </summary>
    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class user_comsume_his_dto_ex : user_comsume_his_dto {
        /// <summary>
        /// 用户地址
        /// </summary>
        public string user_address { get; set; }
        /// <summary>
        /// 收件人
        /// </summary>
        public string ship_to { get; set; }
        /// <summary>
        /// 收件人联系电话
        /// </summary>
        public string ship_phone { get; set; }
    }


    /// <summary>
    /// 用户商品兑换记录
    /// </summary>
    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class user_exchange_product_his_dto {
        /// <summary>
        /// 商品Id
        /// </summary>
        public long product_id { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        public string product_title { get; set; }

        /// <summary>
        /// 商品图片
        /// </summary>
        public string product_img_url { get; set; }

        /// <summary>
        /// 消费红钻数
        /// </summary>
        public decimal consume_red_drill { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime create_time { get; set; }

        /// <summary>
        /// 兑换状态（1：待发货，2：失败，3：已发货）
        /// </summary>
        public int status { get; set; }

        /// <summary>
        /// 是否允许重新兑换
        /// </summary>
        public bool is_allow_exchange_again { get; set; }

    }
}
